home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / cg / bumplines.rexx < prev    next >
OS/2 REXX Batch file  |  1995-09-08  |  1KB  |  52 lines

  1. /* BumpLines.rexx V2.0 -- Pushes lines up and spaces them evenly */
  2. /* By Bob Caron © 1995 NewTek, Inc.                              */
  3.  
  4. call remlib(CG_AREXX)
  5. call addlib(CG_AREXX,0)
  6.  
  7. page_type=GET_PAGE(TYPE)
  8. page_limit=400
  9.  
  10. if page_type = 'Scroll' then page_limit = 0
  11.  
  12. if page_type = 'Crawl' then do
  13.    REQ_ASK("This macro wont","work on crawl","pages.")
  14.    exit
  15. end
  16.  
  17. space=REQ_STRING("Space Between Lines?",3)
  18. if space < 1 then space=1
  19. current_line=1
  20.  
  21. total_lines=GET_PAGE(SIZE)
  22. lastsize=0
  23. do while current_line <= total_lines
  24.    call SET_LINE(current_line)
  25.    call PICKLINE()
  26.    line_pos=GET_LINE(SPOT)
  27.    lastsize=bump_line(line_pos' 'current_line' 'space' 'page_limit' 'lastsize)
  28.    current_line=current_line+1
  29. end
  30.  
  31. call PICKPAGE(NOT)
  32. call remlib(CG_AREXX)
  33.  
  34. exit
  35.  
  36. /* Subroutines */
  37.  
  38. bump_line: procedure
  39. arg x y line space page_limit lastsize
  40.    font_tall=get_line(TALL)
  41.    new_y=lastsize
  42.    if new_y<10 then do
  43.       new_y=10
  44.       lastsize=new_y
  45.    end
  46.    if (page_limit = 400) & (new_y>400) then
  47.        new_y = 400-font_tall
  48.    else
  49.    line_type=GET_LINE(TYPE)
  50.    if line_type = 'Text' then call SET_LINE(SPOT,x,new_y)
  51. return lastsize+font_tall+space
  52.